$(function(){
	var data = {
			url:path+'/production/pro-statics',
			method: 'GET',//请求方式（*）
			contentType : "application/x-www-form-urlencoded;charset='UTF-8'",
			sortable: true,
			sortOrder: "asc",
			search: false,
			columns:[
			    [   
			    	{
			    		checkbox:true,
			    		colspan: 1,
			            rowspan: 2
			    	},{
			    		field: 'id',
			            colspan: 1,
			            rowspan: 2,
			            visible: false
					},{
			        	field: 'datetime',
			            title: "日期",
			            halign:"center",
			            align: "center",
			            colspan: 1,
			            rowspan: 2
			        },{
			        	field: 'group',
			            title: "拉线组",
			            halign:"center",
			            align:"center",
			            colspan: 1,
			            rowspan: 2
			        },{
			        	field: 'name',
			            title: "名称",
			            halign:"center",
			            align:"center",
			            colspan: 1,
			            rowspan: 2
			        },{
			        	field: 'model',
			            title: "型号",
			            halign:"center",
			            align:"center",
			            colspan: 1,
			            rowspan: 2
			        },{
			        	field: 'nature',
			            title: "性质",
			            halign:"center",
			            align:"center",
			            colspan: 1,
			            rowspan: 2
			        },{
			        	field: 'productionDate',
			            title: "生产日期",
			            halign:"center",
			            align:"center",
			            colspan: 1,
			            rowspan: 2
			        },{
			        	field: 'inNumber',
			            title: "投入数",
			            halign: "center",
			            align: "center",
			            colspan: 1,
			            rowspan: 2
			        },{
			        	field: 'atNumber',
			            title: "在线品数",
			            halign:"center",
			            align:"center",
			            colspan: 1,
			            rowspan: 2
			        },{
			        	field: 'onNumber',
			            title: "完工数",
			            halign:"center",
			            align:"center",
			            colspan: 1,
			            rowspan: 2
			        },{
			        	field: 'badNumber',
			            title: "坏品数",
			            halign:"center",
			            align:"center",
			            colspan: 1,
			            rowspan: 2
			        },{
			            title: "不良品率",
			            halign:"center",
			            align:"center",
			            colspan: 8,
			            rowspan: 1
			        },{
			        	field: 'productionPeople',
			            title: "生产人员",
			            halign:"center",
			            align:"center",
			            colspan: 1,
			            rowspan: 2
			        },{
			        	field: 'badRate',
			            title: "不合格率",
			            halign:"center",
			            align:"center",
			            colspan: 1,
			            rowspan: 2
			        },{
			        	field: 'remark',
			            title: "备注",
			            halign:"center",
			            align:"center",
			            colspan: 1,
			            rowspan: 2
			        }
			    ],[
			        {
			            field: 'mainboardNumber',
			            title: "主板数",
			            valign:"middle",
			            align:"center",
			            colspan: 1,
			            rowspan: 1
			        },{
			        	field: 'ampMb',
			            title: "功放板",
			            valign:"middle",
			            align:"center",
			            colspan: 1,
			            rowspan: 1
			        },{
			        	field: 'electricMotor',
			            title: "电机",
			            valign:"middle",
			            align:"center",
			            colspan: 1,
			            rowspan: 1
			        },{
			        	field: 'led',
			            title: "灯珠",
			            valign:"middle",
			            align:"center",
			            colspan: 1,
			            rowspan: 1
			        },{
			        	field: 'powerSupply',
			            title: "电源",
			            valign:"middle",
			            align:"center",
			            colspan: 1,
			            rowspan: 1
			        },{
			        	field: 'fan',
			            title: "风扇",
			            valign:"middle",
			            align:"center",
			            colspan: 1,
			            rowspan: 1
			        },{
			        	field: 'powerCord',
			            title: "电源线",
			            valign:"middle",
			            align:"center",
			            colspan: 1,
			            rowspan: 1
			        },{
			        	field: 'other',
			            title: "其他",
			            valign:"middle",
			            align:"center",
			            colspan: 1,
			            rowspan: 1
			        }
			    ]
			],
			exportOptions:{  
			   fileName: '货物清单列表'+exportDate.toLocaleString(),
			   worksheetName: 'sheet1',//表格工作区名称  
			   tableName: '货物清单列表',
				           ignoreColumn: [0,1],
						   unaffectedColumn:0
			}
	}
	
	var param = [{text:"生产日期",name:"dateScope",type:"text",verify:""},{text:"拉线组",name:"group",type:"text",verify:""},{text:"名称",name:"name",type:"text",verify:""}];
	
	//渲染表格
	renderTable(cTable,data);
	
	createQueryPanel(param);
	
	//条件查询 日期组建渲染
	laydate.render({
		 elem:  "[name='dateScope']"
		 ,type: 'datetime'
		 ,range: true
	});

	//渲染组建
	form.render();
})

//添加按钮
$("#add_btn").click(function(){
	openOperateWindow({
		title: "生产情况添加",
		url: "/admin/enterpriseManagement/productionManagement/productionStatistics/production-statistics-add.jsp"
	})
})

//删除按钮
$("#remove_btn").click(function(){
	fixedAlert("禁止删除货物!请到货物盘点中进行操作!",0);
	//equestRemoveData("id","/production/pro-statics");
})

//修改按钮
$("#modify_btn").click(function(){
	openOperateWindow({
		title: "生产情况修改",
		isUpdate: true,
		url: "/admin/enterpriseManagement/productionManagement/productionStatistics/production-statistics-update.jsp"
	})
})